Niklaus von Dreyse invented his needle gun, the first successful breech-loading rifle, in 1829, but this weapon was not adopted by the Prussian Army until 1840. Other armies were even slower to upgrade, and Austria lost the battle of Sadowa to Prussia in 1866 at least in part due to the superiority of the needle gun. However, even without the breech-loading feature, small arms at mid-century were much more deadly than Napoleonic Era muskets. During the American Civil War both sides experienced the horrible cost of attacking entrenched infantry armed with long range rifles. During the 1860s, France equipped its army with a superior breech-loading rifle, the Chassepot, which led all the great powers to rapidly upgrade their infantry weapons. By the 1880s, all modern armies were equipped with bolt action magazine rifles. This weapon allows the military to recruit Rifle Infantry, Guards, and Carbine Cavalry, and to upgrade older regiments to these modern units.